﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using AmazonDynamoDBStub.Models;
using AmazonDynamoDBStub.EntityFramework.Mapping;

namespace AmazonDynamoDBStub.EntityFramework
{
    public class DynamoDBStubContext : DbContext
    {
        public DbSet<DynamoDBTable> DynamoDBTables { get; set; }
        public DbSet<DynamoDBAttribute> DynamoDBAttributes { get; set; }

        public DynamoDBStubContext()
            : base("DynamoDBStub")
        {

        }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new DynamoDBTableMap());
            modelBuilder.Configurations.Add(new DynamoDBAttributeMap());
            modelBuilder.ComplexType<DynamoDBKey>();
        }
    }
}
